/*! \file logingui.h	
	This is the header file for logingui.cpp
	
	This contains the LoginGUI class
*/

#ifndef LOGIN_GUI_H
#define LOGIN_GUI_H

#include "gui.h"

/**
	\class LoginGUI

	This is an example login window.

*/
class LoginGUI : public Container {
private:
	

	class Test : public Listener {
	public:
		virtual void onEnter( Event e ) {
			HoverText::getInstance()->setWidth( 200 ); // set width before setting text
			int i = rand()%3;
			string s = "This is example hover-text";
			switch( i ) {
				case 0: s = "Small"; break;
				case 1: s = "The box will resize only vertically. You have to set the width beforehand."; break;
					default: break;
				}
			HoverText::getInstance()->setText( s );
			
			
			int mX, mY;
			glfwGetMousePos( &mX, &mY );
			
			HoverText::getInstance()->setPosition( mX,mY );
			HoverText::getInstance()->setVisible( true );
			//~ GUI::getInstance()->setFocusedComponent( HoverText::getInstance() );
		}
		virtual void mouseDown( Event e ) { 
			//~ HoverText::getInstance()->setVisible( false );	
		}
		virtual void mouseUp( Event e ) {}
		virtual void onLeave( Event e ) { cout << "ONLEAVE TRIGGERED!" << endl; HoverText::getInstance()->setVisible( false ); }
		virtual void mouseMove( Event e ) {}
	} test;

	// NOTE NOTE NOTE:
	// Sub-object construct order comes into play since we're using direct variables.
	// The order in which these are created affects the tab order, so put them in the order
	// that you want to tab through them here.
	StaticText userText; //!< Initial value: "User:"
	TextLine userField; //!< input field for username
	StaticText passText; //!< Initial value:  "Password:"
	TextLine passField; //!< input field for password
	/**
	* Label: "Accept". This will be the okayButton (see \link container.h \endlink )
	*/
	Button acceptButton;
	/**
	* Label: "Cancel". This will be the cancelButton (see \link container.h \endlink )
	*/
	Button cancelButton;
	TestObserver* t; //!< This should be replaced or renamed, but right now it's basically nothing.
public:
	LoginGUI();
	virtual void layout();
};

#endif
